home *** CD-ROM | disk | FTP | other *** search
- package kool;
-
- import com.siemens.mp.game.Sprite;
-
- public class Obstacle extends Sprite {
- // $FF: renamed from: H int
- public static final int field_0 = 1;
- // $FF: renamed from: V int
- public static final int field_1 = 2;
- public int type;
- public int[] rect;
- private static byte[] wallh_bin = new byte[]{-1, -32, -86, -96, -1, -32};
- private static byte[] wallh_mask = new byte[]{-1, -32, -1, -32, -1, -32};
- private static byte[] wallv_bin = new byte[]{-32, -96, -32, -96, -32, -96, -32, -96, -32, -96, -32};
- private static byte[] wallv_mask = new byte[]{-32, -32, -32, -32, -32, -32, -32, -32, -32, -32, -32};
-
- public Obstacle(int type) {
- super(type == 1 ? wallh_bin : wallv_bin, 0, type == 1 ? 16 : 8, type == 1 ? 3 : 11, type == 1 ? wallh_mask : wallv_mask, 0, 1);
- if (type == 1) {
- this.setCollisionRectangle(0, 0, 11, 3);
- } else {
- this.setCollisionRectangle(0, 0, 3, 11);
- }
-
- this.type = type;
- }
-
- public void setCollisionRectangle(int x, int y, int dx, int dy) {
- super.setCollisionRectangle(x, y, dx, dy);
- this.rect = new int[]{x, y, dx, dy};
- }
-
- public int[] getCollisionRectangle() {
- return new int[]{((Sprite)this).getXPosition() + this.rect[0], ((Sprite)this).getYPosition() + this.rect[1], this.rect[2], this.rect[3]};
- }
- }
-